package com.ss.android.article.base.feature.detail2.widget.a;

import android.content.Context;
import android.widget.TextView;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.NightModeAsyncImageView;

public final class DetailAdImageLayout extends BaseDetailLayout {
    private NightModeAsyncImageView adImageIv;
    private TextView adImageLabelTv;

    public DetailAdImageLayout(Context arg1) {
        super(arg1);
    }

    public final void setImageUrl(String url, int width, int height) {
        this.adImageIv.setUrl(url);
        this.adImageIv.setAspectRatio((((float)width)) / (((float)height)));
    }

    public final void adaptNightMode(boolean arg3) {
        super.adaptNightMode(arg3);
        UIUtils.setBackgroundResource(this.adImageIv, R.drawable.detail_ad_banner_bg);
        this.adImageIv.adaptNightMode(arg3);
    }

    public final void initView() {
        super.initView();
        this.adImageIv = this.findViewById(com.ss.android.article.browser.R.id.ad_image);
        this.adImageLabelTv = this.findViewById(com.ss.android.article.browser.R.id.ad_image_label);
    }

    public final int getLayoutRes() {
        return R.layout.new_ad_image_layout;
    }

    public final void setText(String arg2) {
        this.adImageLabelTv.setText(((CharSequence)arg2));
    }
}

